/// <summary> MP3TrackIterator.java
/// 
/// </summary>
/// <author>  Created by Omnicore CodeGuide
/// </author>
using System;
namespace XTCast.Mp3 {
	
	public class MP3TrackIterator : System.Collections.IEnumerator {
		public virtual System.Object Current {
			get {
				return nextTrack();
			}
			
		}
		
		internal MP3Track[] fTracks;
		internal int pos = 0;
		
		//UPGRADE_ISSUE: Class hierarchy differences between ''java.util.List'' and ''SupportClass.ListCollectionSupport'' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"'
		public MP3TrackIterator(SupportClass.ListCollectionSupport tracks) {
			fTracks = (MP3Track[]) tracks.ToArray(new MP3Track[0]);
		}
		
		public MP3TrackIterator(MP3Track[] tracks) {
			fTracks = new MP3Track[tracks.Length];
			tracks.CopyTo(fTracks, 0);
		}
		
		public virtual int length() {
			return fTracks.Length;
		}
		
		public virtual bool MoveNext() {
			return (pos < length());
		}
		
		public virtual bool hasPrevious() {
			return (pos > 0);
		}
		
		public virtual MP3Track nextTrack() {
			//UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilIteratorhasNext"'
			if (!MoveNext())
				throw new System.ArgumentOutOfRangeException();
			return fTracks[pos++];
		}
		
		public virtual MP3Track previousTrack() {
			if (!hasPrevious())
				throw new System.ArgumentOutOfRangeException();
			return fTracks[--pos];
		}
		
		public virtual void  move(int index) {
			if (index < 0 || index > length())
				throw new System.ArgumentOutOfRangeException();
			pos = index;
		}
		
		public virtual void  moveLast() {
			pos = length();
		}
		
		//UPGRADE_TODO: The equivalent of method 'java.util.Iterator.remove' is not an override method. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1143"'
		public void  remove() {
			throw new System.NotSupportedException();
		}
	
		public void Reset() {
			throw new System.NotSupportedException();

		}
	}
}